<template>
  <div class="my_input">
    <input type="text" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" @keydown.enter="$emit('search')" placeholder="请输入搜索内容">
    <button @click="$emit('search')">搜索</button>
  </div>
</template>

<script>
import { ref, reactive, toRefs } from "vue";
export default {
  props:{
    modelValue: String
  },
  setup() {},
};
</script>
<style lang="scss" scoped>
.my_input{
  height: 50px;
  display: flex;
  align-items: center;
  input{
    height: 36px;
    background: #ccc;
    border: none;
    outline: none;
    padding: 0 10px;
    flex: 1;
  }
  button{
    width: 70px;
    height: 36px;
    background: cornflowerblue;
    color: #fff;
    text-align: center;
    border: none;
  }
}
</style>